<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./css/index.css">
</head>

<body>
  <div class="box">
    <div class="item"><img src="imgs/01.jpg" alt=""></div>
    <div class="item"><img src="imgs/02.jpg" alt=""></div>
    <div class="item"><img src="imgs/03.jpg" alt=""></div>
    <div class="item"><img src="imgs/04.jpg" alt=""></div>
    <div class="item"><img src="imgs/05.jpg" alt=""></div>
    <div class="item"><img src="imgs/06.jpg" alt=""></div>
  </div>

  <script src="./js/jquery-3.6.0.js"></script>
  <script>
    // $('.item').hover(function () {
    //   $(this).stop().fadeTo(300, 1).siblings().stop().fadeTo(300, 0.3);
    // }, function () {
    //   $('.item').stop().fadeTo(300, 1);
    // });


    // 同学们的建议（）
    $('.item').on('mouseenter', function () {
      $(this).stop().fadeTo(300, 1).siblings().stop().fadeTo(300, 0.3);
    })

    $('.box').on('mouseleave', function () {
      $('.item').stop().fadeTo(300, 1)
    })
  </script>
</body>

</html>